﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="Page_ManagePrice.aspx.cs" Inherits="Admin_Page_ManagePrice" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 100%">
        <tr>
            <td align="center">
                <asp:Label ID="lblDichVu" runat="server" Font-Size="Medium" ForeColor="#009900"></asp:Label>
                <br />
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                    BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                    DataKeyNames="Ma" DataSourceID="SqlDataSource1" Width="606px">
                    <RowStyle BackColor="White" ForeColor="#003399" />
                    <Columns>
                        <asp:CommandField ButtonType="Image" CancelImageUrl="~/images/Cancel-icon.png" 
                            DeleteImageUrl="~/images/delete-icon.png" EditImageUrl="~/images/edit-icon.png" 
                            ShowDeleteButton="True" ShowEditButton="True" 
                            UpdateImageUrl="~/images/ok-icon.png">
                        <ItemStyle Width="50px" />
                        </asp:CommandField>
                        <asp:BoundField DataField="Ma" HeaderText="Mã" InsertVisible="False" 
                            ReadOnly="True" SortExpression="Ma">
                        <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ThoiGian" HeaderText="Thời gian" 
                            SortExpression="ThoiGian">
                        <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="GiaUSD" HeaderText="Giá USD" SortExpression="GiaUSD">
                        <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="GiaVND" HeaderText="Giá VND" SortExpression="GiaVND">
                        <ItemStyle Width="80px" />
                        </asp:BoundField>
                    </Columns>
                    <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                    <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                    <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                    <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:TramHuongDB2ConnectionString %>" 
                    DeleteCommand="DELETE FROM [BangGiaDV] WHERE [Ma] = @Ma" 
                    InsertCommand="INSERT INTO [BangGiaDV] ([MaDichVu], [ThoiGian], [GiaUSD], [GiaVND]) VALUES (@MaDichVu, @ThoiGian, @GiaUSD, @GiaVND)" 
                    SelectCommand="SELECT * FROM [BangGiaDV] WHERE ([MaDichVu] = @MaDichVu)" 
                    UpdateCommand="UPDATE [BangGiaDV] SET [MaDichVu] = @MaDichVu, [ThoiGian] = @ThoiGian, [GiaUSD] = @GiaUSD, [GiaVND] = @GiaVND WHERE [Ma] = @Ma">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="MaDichVu" QueryStringField="Id" Type="Int32" />
                    </SelectParameters>
                    <DeleteParameters>
                        <asp:Parameter Name="Ma" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:QueryStringParameter Name="MaDichVu" QueryStringField="Id" Type="Int32" />
                        <asp:Parameter Name="ThoiGian" Type="String" />
                        <asp:Parameter Name="GiaUSD" Type="String" />
                        <asp:Parameter Name="GiaVND" Type="String" />
                        <asp:Parameter Name="Ma" Type="Int32" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:QueryStringParameter Name="MaDichVu" QueryStringField="Id" Type="Int32" />
                        <asp:Parameter Name="ThoiGian" Type="String" />
                        <asp:Parameter Name="GiaUSD" Type="String" />
                        <asp:Parameter Name="GiaVND" Type="String" />
                    </InsertParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                    BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" 
                    CellPadding="2" DataKeyNames="Ma" DataSourceID="SqlDataSource1" 
                    DefaultMode="Insert" ForeColor="Black" GridLines="None" Height="50px" 
                    Width="315px">
                    <FooterStyle BackColor="Tan" />
                    <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                        HorizontalAlign="Center" />
                    <Fields>
                        <asp:BoundField DataField="Ma" HeaderText="Mã" InsertVisible="False" 
                            ReadOnly="True" SortExpression="Ma"></asp:BoundField>
                        <asp:BoundField DataField="ThoiGian" HeaderText="Thời gian" 
                            SortExpression="ThoiGian">
                        <ItemStyle Width="200px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="GiaUSD" HeaderText="Giá USD" SortExpression="GiaUSD">
                        </asp:BoundField>
                        <asp:BoundField DataField="GiaVND" HeaderText="Giá VND" SortExpression="GiaVND">
                        <ItemStyle Width="200px" />
                        </asp:BoundField>
                        <asp:CommandField ShowInsertButton="True" />
                    </Fields>
                    <HeaderStyle BackColor="Tan" Font-Bold="True" />
                    <EditRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                    <AlternatingRowStyle BackColor="PaleGoldenrod" />
                </asp:DetailsView>
            </td>
        </tr>
    </table>
</asp:Content>

